package com.example.spidertp.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.spidertp.core.mapper.OperationRecordMapper;
import com.example.spidertp.core.model.entity.OperationRecord;
import com.example.spidertp.core.model.param.OperationRecordQueryParam;
import com.example.spidertp.core.service.TpOperationRecordService;
import org.springframework.stereotype.Service;

/**
 * @author xiong.bo
 * @version 1.0
 * @date 2022/9/18 8:14 下午
 */
@Service
public class TpOperationRecordServiceImpl extends ServiceImpl<OperationRecordMapper, OperationRecord>
        implements TpOperationRecordService {


    @Override
    public IPage<OperationRecord> selectByPage(OperationRecordQueryParam param) {
        Page<OperationRecord> page = new Page(param.getPage(),param.getSize());
        LambdaQueryWrapper<OperationRecord>  queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(OperationRecord::getCreateTime);
        return page(page, queryWrapper);
    }


}
